﻿
namespace SolutionFramework.Service
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Data;
    using System.Linq;
    using System.ServiceModel.DomainServices.EntityFramework;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;
    using SolutionFramework.Entities;
    
    
    // Implements application logic using the SolutionFrameworkEntities context.
    // TODO: Add your application logic to these methods or in additional methods.
    // TODO: Wire up authentication (Windows/ASP.NET Forms) and uncomment the following to disable anonymous access
    // Also consider adding roles to restrict access as appropriate.
    // [RequiresAuthentication]
    [EnableClientAccess()]
    public class CodeGenerationPipelineDomainService : LinqToEntitiesDomainService<SolutionFrameworkEntities>
    {
        
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ArchitectureFeatures' query.
        [Query(IsDefault=true)]
        public IQueryable<ArchitectureFeature> GetArchitectureFeatures()
        {
            return this.ObjectContext.ArchitectureFeatures;
        }
        
        public void InsertArchitectureFeature(ArchitectureFeature architectureFeature)
        {
            if ((architectureFeature.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(architectureFeature, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ArchitectureFeatures.AddObject(architectureFeature);
            }
        }
        
        public void UpdateArchitectureFeature(ArchitectureFeature currentArchitectureFeature)
        {
            this.ObjectContext.ArchitectureFeatures.AttachAsModified(currentArchitectureFeature, this.ChangeSet.GetOriginal(currentArchitectureFeature));
        }
        
        public void DeleteArchitectureFeature(ArchitectureFeature architectureFeature)
        {
            if ((architectureFeature.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(architectureFeature, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ArchitectureFeatures.Attach(architectureFeature);
                this.ObjectContext.ArchitectureFeatures.DeleteObject(architectureFeature);
            }
        }
        
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ArchitectureLayers' query.
        [Query(IsDefault=true)]
        public IQueryable<ArchitectureLayer> GetArchitectureLayers()
        {
            return this.ObjectContext.ArchitectureLayers;
        }
        
        public void InsertArchitectureLayer(ArchitectureLayer architectureLayer)
        {
            if ((architectureLayer.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(architectureLayer, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ArchitectureLayers.AddObject(architectureLayer);
            }
        }
        
        public void UpdateArchitectureLayer(ArchitectureLayer currentArchitectureLayer)
        {
            this.ObjectContext.ArchitectureLayers.AttachAsModified(currentArchitectureLayer, this.ChangeSet.GetOriginal(currentArchitectureLayer));
        }
        
        public void DeleteArchitectureLayer(ArchitectureLayer architectureLayer)
        {
            if ((architectureLayer.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(architectureLayer, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ArchitectureLayers.Attach(architectureLayer);
                this.ObjectContext.ArchitectureLayers.DeleteObject(architectureLayer);
            }
        }
        
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ArchitectureModels' query.
        [Query(IsDefault=true)]
        public IQueryable<ArchitectureModel> GetArchitectureModels()
        {
            return this.ObjectContext.ArchitectureModels;
        }
        
        public void InsertArchitectureModel(ArchitectureModel architectureModel)
        {
            if ((architectureModel.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(architectureModel, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ArchitectureModels.AddObject(architectureModel);
            }
        }
        
        public void UpdateArchitectureModel(ArchitectureModel currentArchitectureModel)
        {
            this.ObjectContext.ArchitectureModels.AttachAsModified(currentArchitectureModel, this.ChangeSet.GetOriginal(currentArchitectureModel));
        }
        
        public void DeleteArchitectureModel(ArchitectureModel architectureModel)
        {
            if ((architectureModel.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(architectureModel, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ArchitectureModels.Attach(architectureModel);
                this.ObjectContext.ArchitectureModels.DeleteObject(architectureModel);
            }
        }
        
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ArchitectureToPipelines' query.
        [Query(IsDefault=true)]
        public IQueryable<ArchitectureToPipeline> GetArchitectureToPipelines()
        {
            return this.ObjectContext.ArchitectureToPipelines;
        }
        
        public void InsertArchitectureToPipeline(ArchitectureToPipeline architectureToPipeline)
        {
            if ((architectureToPipeline.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(architectureToPipeline, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ArchitectureToPipelines.AddObject(architectureToPipeline);
            }
        }
        
        public void UpdateArchitectureToPipeline(ArchitectureToPipeline currentArchitectureToPipeline)
        {
            this.ObjectContext.ArchitectureToPipelines.AttachAsModified(currentArchitectureToPipeline, this.ChangeSet.GetOriginal(currentArchitectureToPipeline));
        }
        
        public void DeleteArchitectureToPipeline(ArchitectureToPipeline architectureToPipeline)
        {
            if ((architectureToPipeline.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(architectureToPipeline, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ArchitectureToPipelines.Attach(architectureToPipeline);
                this.ObjectContext.ArchitectureToPipelines.DeleteObject(architectureToPipeline);
            }
        }
        
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'CodeGenerationPipelines' query.
        [Query(IsDefault=true)]
        public IQueryable<CodeGenerationPipeline> GetCodeGenerationPipelines()
        {
            return this.ObjectContext.CodeGenerationPipelines;
        }
        
        public void InsertCodeGenerationPipeline(CodeGenerationPipeline codeGenerationPipeline)
        {
            if ((codeGenerationPipeline.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(codeGenerationPipeline, EntityState.Added);
            }
            else
            {
                this.ObjectContext.CodeGenerationPipelines.AddObject(codeGenerationPipeline);
            }
        }
        
        public void UpdateCodeGenerationPipeline(CodeGenerationPipeline currentCodeGenerationPipeline)
        {
            this.ObjectContext.CodeGenerationPipelines.AttachAsModified(currentCodeGenerationPipeline, this.ChangeSet.GetOriginal(currentCodeGenerationPipeline));
        }
        
        public void DeleteCodeGenerationPipeline(CodeGenerationPipeline codeGenerationPipeline)
        {
            if ((codeGenerationPipeline.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(codeGenerationPipeline, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.CodeGenerationPipelines.Attach(codeGenerationPipeline);
                this.ObjectContext.CodeGenerationPipelines.DeleteObject(codeGenerationPipeline);
            }
        }
        
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'CodeProjectProviders' query.
        [Query(IsDefault=true)]
        public IQueryable<CodeProjectProvider> GetCodeProjectProviders()
        {
            return this.ObjectContext.CodeProjectProviders;
        }
        
        public void InsertCodeProjectProvider(CodeProjectProvider codeProjectProvider)
        {
            if ((codeProjectProvider.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(codeProjectProvider, EntityState.Added);
            }
            else
            {
                this.ObjectContext.CodeProjectProviders.AddObject(codeProjectProvider);
            }
        }
        
        public void UpdateCodeProjectProvider(CodeProjectProvider currentCodeProjectProvider)
        {
            this.ObjectContext.CodeProjectProviders.AttachAsModified(currentCodeProjectProvider, this.ChangeSet.GetOriginal(currentCodeProjectProvider));
        }
        
        public void DeleteCodeProjectProvider(CodeProjectProvider codeProjectProvider)
        {
            if ((codeProjectProvider.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(codeProjectProvider, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.CodeProjectProviders.Attach(codeProjectProvider);
                this.ObjectContext.CodeProjectProviders.DeleteObject(codeProjectProvider);
            }
        }
        
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'FeatureToArchitectures' query.
        [Query(IsDefault=true)]
        public IQueryable<FeatureToArchitecture> GetFeatureToArchitectures()
        {
            return this.ObjectContext.FeatureToArchitectures;
        }
        
        public void InsertFeatureToArchitecture(FeatureToArchitecture featureToArchitecture)
        {
            if ((featureToArchitecture.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(featureToArchitecture, EntityState.Added);
            }
            else
            {
                this.ObjectContext.FeatureToArchitectures.AddObject(featureToArchitecture);
            }
        }
        
        public void UpdateFeatureToArchitecture(FeatureToArchitecture currentFeatureToArchitecture)
        {
            this.ObjectContext.FeatureToArchitectures.AttachAsModified(currentFeatureToArchitecture, this.ChangeSet.GetOriginal(currentFeatureToArchitecture));
        }
        
        public void DeleteFeatureToArchitecture(FeatureToArchitecture featureToArchitecture)
        {
            if ((featureToArchitecture.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(featureToArchitecture, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.FeatureToArchitectures.Attach(featureToArchitecture);
                this.ObjectContext.FeatureToArchitectures.DeleteObject(featureToArchitecture);
            }
        }
        
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'PipelineSteps' query.
        [Query(IsDefault=true)]
        public IQueryable<PipelineStep> GetPipelineSteps()
        {
            return this.ObjectContext.PipelineSteps;
        }
        
        public void InsertPipelineStep(PipelineStep pipelineStep)
        {
            if ((pipelineStep.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pipelineStep, EntityState.Added);
            }
            else
            {
                this.ObjectContext.PipelineSteps.AddObject(pipelineStep);
            }
        }
        
        public void UpdatePipelineStep(PipelineStep currentPipelineStep)
        {
            this.ObjectContext.PipelineSteps.AttachAsModified(currentPipelineStep, this.ChangeSet.GetOriginal(currentPipelineStep));
        }
        
        public void DeletePipelineStep(PipelineStep pipelineStep)
        {
            if ((pipelineStep.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pipelineStep, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.PipelineSteps.Attach(pipelineStep);
                this.ObjectContext.PipelineSteps.DeleteObject(pipelineStep);
            }
        }
        
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'PipelineStepFileCreationTemplates' query.
        [Query(IsDefault=true)]
        public IQueryable<PipelineStepFileCreationTemplate> GetPipelineStepFileCreationTemplates()
        {
            return this.ObjectContext.PipelineStepFileCreationTemplates;
        }
        
        public void InsertPipelineStepFileCreationTemplate(PipelineStepFileCreationTemplate pipelineStepFileCreationTemplate)
        {
            if ((pipelineStepFileCreationTemplate.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pipelineStepFileCreationTemplate, EntityState.Added);
            }
            else
            {
                this.ObjectContext.PipelineStepFileCreationTemplates.AddObject(pipelineStepFileCreationTemplate);
            }
        }
        
        public void UpdatePipelineStepFileCreationTemplate(PipelineStepFileCreationTemplate currentPipelineStepFileCreationTemplate)
        {
            this.ObjectContext.PipelineStepFileCreationTemplates.AttachAsModified(currentPipelineStepFileCreationTemplate, this.ChangeSet.GetOriginal(currentPipelineStepFileCreationTemplate));
        }
        
        public void DeletePipelineStepFileCreationTemplate(PipelineStepFileCreationTemplate pipelineStepFileCreationTemplate)
        {
            if ((pipelineStepFileCreationTemplate.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pipelineStepFileCreationTemplate, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.PipelineStepFileCreationTemplates.Attach(pipelineStepFileCreationTemplate);
                this.ObjectContext.PipelineStepFileCreationTemplates.DeleteObject(pipelineStepFileCreationTemplate);
            }
        }
        
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'PipelineStepFileTemplates' query.
        [Query(IsDefault=true)]
        public IQueryable<PipelineStepFileTemplate> GetPipelineStepFileTemplates()
        {
            return this.ObjectContext.PipelineStepFileTemplates;
        }
        
        public void InsertPipelineStepFileTemplate(PipelineStepFileTemplate pipelineStepFileTemplate)
        {
            if ((pipelineStepFileTemplate.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pipelineStepFileTemplate, EntityState.Added);
            }
            else
            {
                this.ObjectContext.PipelineStepFileTemplates.AddObject(pipelineStepFileTemplate);
            }
        }
        
        public void UpdatePipelineStepFileTemplate(PipelineStepFileTemplate currentPipelineStepFileTemplate)
        {
            this.ObjectContext.PipelineStepFileTemplates.AttachAsModified(currentPipelineStepFileTemplate, this.ChangeSet.GetOriginal(currentPipelineStepFileTemplate));
        }
        
        public void DeletePipelineStepFileTemplate(PipelineStepFileTemplate pipelineStepFileTemplate)
        {
            if ((pipelineStepFileTemplate.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pipelineStepFileTemplate, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.PipelineStepFileTemplates.Attach(pipelineStepFileTemplate);
                this.ObjectContext.PipelineStepFileTemplates.DeleteObject(pipelineStepFileTemplate);
            }
        }
        
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'PipelineStepPrerequisites' query.
        [Query(IsDefault=true)]
        public IQueryable<PipelineStepPrerequisite> GetPipelineStepPrerequisites()
        {
            return this.ObjectContext.PipelineStepPrerequisites;
        }
        
        public void InsertPipelineStepPrerequisite(PipelineStepPrerequisite pipelineStepPrerequisite)
        {
            if ((pipelineStepPrerequisite.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pipelineStepPrerequisite, EntityState.Added);
            }
            else
            {
                this.ObjectContext.PipelineStepPrerequisites.AddObject(pipelineStepPrerequisite);
            }
        }
        
        public void UpdatePipelineStepPrerequisite(PipelineStepPrerequisite currentPipelineStepPrerequisite)
        {
            this.ObjectContext.PipelineStepPrerequisites.AttachAsModified(currentPipelineStepPrerequisite, this.ChangeSet.GetOriginal(currentPipelineStepPrerequisite));
        }
        
        public void DeletePipelineStepPrerequisite(PipelineStepPrerequisite pipelineStepPrerequisite)
        {
            if ((pipelineStepPrerequisite.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pipelineStepPrerequisite, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.PipelineStepPrerequisites.Attach(pipelineStepPrerequisite);
                this.ObjectContext.PipelineStepPrerequisites.DeleteObject(pipelineStepPrerequisite);
            }
        }
        
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'PipelineSupportedLanguages' query.
        [Query(IsDefault=true)]
        public IQueryable<PipelineSupportedLanguage> GetPipelineSupportedLanguages()
        {
            return this.ObjectContext.PipelineSupportedLanguages;
        }
        
        public void InsertPipelineSupportedLanguage(PipelineSupportedLanguage pipelineSupportedLanguage)
        {
            if ((pipelineSupportedLanguage.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pipelineSupportedLanguage, EntityState.Added);
            }
            else
            {
                this.ObjectContext.PipelineSupportedLanguages.AddObject(pipelineSupportedLanguage);
            }
        }
        
        public void UpdatePipelineSupportedLanguage(PipelineSupportedLanguage currentPipelineSupportedLanguage)
        {
            this.ObjectContext.PipelineSupportedLanguages.AttachAsModified(currentPipelineSupportedLanguage, this.ChangeSet.GetOriginal(currentPipelineSupportedLanguage));
        }
        
        public void DeletePipelineSupportedLanguage(PipelineSupportedLanguage pipelineSupportedLanguage)
        {
            if ((pipelineSupportedLanguage.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pipelineSupportedLanguage, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.PipelineSupportedLanguages.Attach(pipelineSupportedLanguage);
                this.ObjectContext.PipelineSupportedLanguages.DeleteObject(pipelineSupportedLanguage);
            }
        }
        
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'PipelineSupportedProviders' query.
        [Query(IsDefault=true)]
        public IQueryable<PipelineSupportedProvider> GetPipelineSupportedProviders()
        {
            return this.ObjectContext.PipelineSupportedProviders;
        }
        
        public void InsertPipelineSupportedProvider(PipelineSupportedProvider pipelineSupportedProvider)
        {
            if ((pipelineSupportedProvider.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pipelineSupportedProvider, EntityState.Added);
            }
            else
            {
                this.ObjectContext.PipelineSupportedProviders.AddObject(pipelineSupportedProvider);
            }
        }
        
        public void UpdatePipelineSupportedProvider(PipelineSupportedProvider currentPipelineSupportedProvider)
        {
            this.ObjectContext.PipelineSupportedProviders.AttachAsModified(currentPipelineSupportedProvider, this.ChangeSet.GetOriginal(currentPipelineSupportedProvider));
        }
        
        public void DeletePipelineSupportedProvider(PipelineSupportedProvider pipelineSupportedProvider)
        {
            if ((pipelineSupportedProvider.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(pipelineSupportedProvider, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.PipelineSupportedProviders.Attach(pipelineSupportedProvider);
                this.ObjectContext.PipelineSupportedProviders.DeleteObject(pipelineSupportedProvider);
            }
        }
        
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ProgrammingLanguages' query.
        [Query(IsDefault=true)]
        public IQueryable<ProgrammingLanguage> GetProgrammingLanguages()
        {
            var languages = new List<ProgrammingLanguage>() { new ProgrammingLanguage { LanguageName = "C#" } };

            return languages.AsQueryable<ProgrammingLanguage>();

            //return this.ObjectContext.ProgrammingLanguages;
        }
        
        public void InsertProgrammingLanguage(ProgrammingLanguage programmingLanguage)
        {
            if ((programmingLanguage.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(programmingLanguage, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ProgrammingLanguages.AddObject(programmingLanguage);
            }
        }
        
        public void UpdateProgrammingLanguage(ProgrammingLanguage currentProgrammingLanguage)
        {
            this.ObjectContext.ProgrammingLanguages.AttachAsModified(currentProgrammingLanguage, this.ChangeSet.GetOriginal(currentProgrammingLanguage));
        }
        
        public void DeleteProgrammingLanguage(ProgrammingLanguage programmingLanguage)
        {
            if ((programmingLanguage.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(programmingLanguage, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ProgrammingLanguages.Attach(programmingLanguage);
                this.ObjectContext.ProgrammingLanguages.DeleteObject(programmingLanguage);
            }
        }
        
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ProjectStructures' query.
        [Query(IsDefault=true)]
        public IQueryable<ProjectStructure> GetProjectStructures()
        {
            return this.ObjectContext.ProjectStructures;
        }
        
        public void InsertProjectStructure(ProjectStructure projectStructure)
        {
            if ((projectStructure.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(projectStructure, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ProjectStructures.AddObject(projectStructure);
            }
        }
        
        public void UpdateProjectStructure(ProjectStructure currentProjectStructure)
        {
            this.ObjectContext.ProjectStructures.AttachAsModified(currentProjectStructure, this.ChangeSet.GetOriginal(currentProjectStructure));
        }
        
        public void DeleteProjectStructure(ProjectStructure projectStructure)
        {
            if ((projectStructure.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(projectStructure, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ProjectStructures.Attach(projectStructure);
                this.ObjectContext.ProjectStructures.DeleteObject(projectStructure);
            }
        }
        
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'ProviderSupportedLanguages' query.
        [Query(IsDefault=true)]
        public IQueryable<ProviderSupportedLanguage> GetProviderSupportedLanguages()
        {
            return this.ObjectContext.ProviderSupportedLanguages;
        }
        
        public void InsertProviderSupportedLanguage(ProviderSupportedLanguage providerSupportedLanguage)
        {
            if ((providerSupportedLanguage.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(providerSupportedLanguage, EntityState.Added);
            }
            else
            {
                this.ObjectContext.ProviderSupportedLanguages.AddObject(providerSupportedLanguage);
            }
        }
        
        public void UpdateProviderSupportedLanguage(ProviderSupportedLanguage currentProviderSupportedLanguage)
        {
            this.ObjectContext.ProviderSupportedLanguages.AttachAsModified(currentProviderSupportedLanguage, this.ChangeSet.GetOriginal(currentProviderSupportedLanguage));
        }
        
        public void DeleteProviderSupportedLanguage(ProviderSupportedLanguage providerSupportedLanguage)
        {
            if ((providerSupportedLanguage.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(providerSupportedLanguage, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.ProviderSupportedLanguages.Attach(providerSupportedLanguage);
                this.ObjectContext.ProviderSupportedLanguages.DeleteObject(providerSupportedLanguage);
            }
        }
        
        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'TemplateFormats' query.
        [Query(IsDefault=true)]
        public IQueryable<TemplateFormat> GetTemplateFormats()
        {
            return this.ObjectContext.TemplateFormats;
        }
        
        public void InsertTemplateFormat(TemplateFormat templateFormat)
        {
            if ((templateFormat.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(templateFormat, EntityState.Added);
            }
            else
            {
                this.ObjectContext.TemplateFormats.AddObject(templateFormat);
            }
        }
        
        public void UpdateTemplateFormat(TemplateFormat currentTemplateFormat)
        {
            this.ObjectContext.TemplateFormats.AttachAsModified(currentTemplateFormat, this.ChangeSet.GetOriginal(currentTemplateFormat));
        }
        
        public void DeleteTemplateFormat(TemplateFormat templateFormat)
        {
            if ((templateFormat.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(templateFormat, EntityState.Deleted);
            }
            else
            {
                this.ObjectContext.TemplateFormats.Attach(templateFormat);
                this.ObjectContext.TemplateFormats.DeleteObject(templateFormat);
            }
        }
    }
}


